home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
networking
/
ip
/
ka9q
/
src890906.arc
/
ENETDUMP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-08-19
|
769b
|
46 lines
#include <stdio.h>
#include "global.h"
#include "mbuf.h"
#include "enet.h"
#include "trace.h"
void
ether_dump(bpp,check)
struct mbuf **bpp;
int check; /* Not used */
{
struct ether ehdr;
char s[20],d[20];
ntohether(&ehdr,bpp);
pether(s,ehdr.source);
pether(d,ehdr.dest);
printf("Ether: len %u %s->%s",ETHERLEN + len_mbuf(*bpp),s,d);
switch(ehdr.type){
case IP_TYPE:
printf(" type IP\n");
ip_dump(bpp,1);
break;
case ARP_TYPE:
printf(" type ARP\n");
arp_dump(bpp);
break;
default:
printf(" type 0x%x\n",ehdr.type);
break;
}
}
int
ether_forus(iface,bp)
struct iface *iface;
struct mbuf *bp;
{
/* Just look at the multicast bit */
if(bp->data[0] & 1)
return 0;
else
return 1;
}